package com.example.idachuappone.person.entity;

import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class MemberYuE {
    private String balance;
    private String in;
    private String out;
    private int page;
    private int page_size;
    private List<MemberYuEDetail> result;
    private int total;

    public void parseJson(JSONObject json) {
        if (json != null) {
            if (json.has("total")) {
                this.total = json.optInt("total");
            }
            if (json.has("page_size")) {
                this.page_size = json.optInt("page_size");
            }
            if (json.has("page")) {
                this.page = json.optInt("page");
            }
            if (json.has("balance")) {
                this.balance = json.optString("balance");
            }
            if (json.has("in")) {
                this.in = json.optString("in");
            }
            if (json.has("out")) {
                this.out = json.optString("out");
            }
            if (json.has("result")) {
                JSONArray jsonArray = json.optJSONArray("result");
                this.result = new ArrayList();
                for (int i = 0; i < jsonArray.length(); i++) {
                    try {
                        JSONObject jsonObject = jsonArray.getJSONObject(i);
                        this.result.add(new MemberYuEDetail().parseJson(jsonObject));
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }

    public int getTotal() {
        return this.total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPage_size() {
        return this.page_size;
    }

    public void setPage_size(int page_size) {
        this.page_size = page_size;
    }

    public int getPage() {
        return this.page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public String getBalance() {
        return this.balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getIn() {
        return this.in;
    }

    public void setIn(String in) {
        this.in = in;
    }

    public String getOut() {
        return this.out;
    }

    public void setOut(String out) {
        this.out = out;
    }

    public List<MemberYuEDetail> getResult() {
        return this.result;
    }

    public void setResult(List<MemberYuEDetail> result) {
        this.result = result;
    }
}
